package 电影院;

import java.util.Scanner;

public class 前台 extends 售票{
    private String name;
    private String mima;
    private int USERID;
    private String date;
    private String liexing="前台";
    private String phonenumber;
    private static int m=100;


    public 前台(String date, String phonenumber) {
        this.name ="qiantai";
        this.mima = "ynuinfo#777";
        this.USERID=m++;
        this.phonenumber=phonenumber;
        this.date=date;
    }
    public int 登录(String name, String mima){
        if (USERID==0){
            System.out.println("你已经不是该影院的员工，请退出");
            return 0;
        }
        if (this.name.equals(name)&&this.mima.equals(mima)){
            System.out.println("恭喜前台登陆成功，开启牛马的一天");
            if(this.mima.equals("123456")){
                System.out.println("请修改密码");
                Scanner sc=new Scanner(System.in);
                setqtMima(sc.nextLine());
            }
            return 1;
        }
        System.out.println("前台登陆失败，开启不了牛马的一天");
        return 0;
    }

    public void 查询上映(排片表 a[]){
        boolean flag=false;
        for (int i = 0; i <a.length; i++) {
            if (a[i].getIfshowon()==1){
                flag=true;
                System.out.println("这部电影已映");
                System.out.println("片名："+a[i].getName());
                System.out.println("导演："+a[i].getDaoyan());
                System.out.println("主演："+a[i].getZhuyao());
                System.out.println("剧情简介："+a[i].getJuqingjianjie());
                System.out.println("时长："+a[i].getTime());
                System.out.println("评分："+a[i].getScore());
            }
        }
        if(!flag)
            System.out.println("还没有电影上映");
    }

    public void 场次信息(放映厅 f[][]){
        for (int i = 0; i <f.length; i++) {
            for (int j = 0; j <f[i].length; j++) {
                System.out.println((i+1)+"号厅");
                System.out.println((j+1)+"场次");
                System.out.println("片名:"+f[i][j].getName());
                }
            }
    }

    public void 退出登录(){
        System.out.println("退出登录成功，工作结束，休息亿下吧");
    }

    public String getLiexing() {
        return liexing;
    }
    public void setLiexing(String liexing) {
        this.liexing = liexing;
    }
    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getUSERID() {
        return USERID;
    }

    public void setUSERID(int USERID) {
        this.USERID = USERID;
    }

    public String getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }
    public String getqtName() {
        return name;
    }

    public void setqtName(String name) {
        this.name = name;
    }

    public String getqtMima() {
        return mima;
    }

    public void setqtMima(String mima) {
        this.mima = mima;
    }
}
